inspector: Avoid a crash
authorMatthias Clasen <mclasen@redhat.com>
Sat, 8 Aug 2020 22:05:21 +0000 (18:05 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 8 Aug 2020 22:33:56 +0000 (18:33 -0400)
I've seen the inspector crash when running on an
X server without an xsettings manager around. Better
be safe.

gtk/inspector/visual.c

index fe8bc9954dd7f1fb2e34cb6e16cf6e48c3c482e6..7cc933ff2aab8cf8a4f85396de98f584a546a32c 100644 (file)
@@ -510,7 +510,7 @@ theme_to_pos (GBinding *binding,
   for (i = 0, n = g_list_model_get_n_items (G_LIST_MODEL (names)); i < n; i++)
     {
       const char *name = gtk_string_list_get_string (names, i);
-      if (strcmp (name, theme) == 0)
+      if (g_strcmp0 (name, theme) == 0)
         {
           g_value_set_uint (to, i);
           return TRUE;